package org.amos.xxljob.job;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class DemoJob {
    @XxlJob("demoJobHandler")
    public ReturnT<String> demoJobHandler() throws Exception {
        String param = XxlJobHelper.getJobParam();
        log.info("----------- 演示任务开始执行 -----------");
        log.info("----------- param:{} -----------", param);
        log.info("----------- 演示任务执行完毕 -----------");
        return ReturnT.SUCCESS;
    }
}
